home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / initrd.lz / initrd / scripts / init-top / compcache < prev    next >
Encoding:
Text File  |  2009-10-28  |  512 b   |  27 lines

  1. #!/bin/sh
  2.  
  3. PREREQ=""
  4. prereqs()
  5. {
  6.      echo "$PREREQ"
  7. }
  8.  
  9. case $1 in
  10. prereqs)
  11.      prereqs
  12.      exit 0
  13.      ;;
  14. esac
  15.  
  16. # find total amount of available ram
  17. TOTAL_RAM=$( grep MemTotal /proc/meminfo |tr -d ': [A-Z][a-z]')
  18.  
  19. # Do not use compcache on the liveCD if we have more than 512M
  20. if [ "${BOOT}" = "casper" ]; then
  21.     if [ "${TOTAL_RAM}" -gt 524288 ]; then
  22.         exit 0
  23.     fi
  24. fi
  25.  
  26. modprobe -q --ignore-install ramzswap disksize_kb="$(($(sed -nre 's/^MemTotal:\s*([0-9]+) kB$/\1/p' /proc/meminfo) * 25 / 100))"
  27.